package com.sanjin.controller;

import com.sanjin.exception.MyException;
import com.sanjin.service.ParkSpaceWxMiniUserRelationService;
import com.sanjin.utils.ResponseVoUtils;
import com.sanjin.utils.ValidateUtils;
import com.sanjin.vo.ResponseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: sanjin
 * @date: 2019/7/3 10:41
 */
@Api(tags = "用户选择停车位接口",description = "用户选择停车位接口")
@RestController
public class ParkSpaceWxMiniUserRelationController {

    @Autowired
    private ParkSpaceWxMiniUserRelationService parkSpaceWxMiniUserRelationService;

    @ApiOperation("用户选择停车位接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "parkSpaceId",value = "停车位id",paramType = "query")
    })
    @PostMapping("/selectParkSpace")
    public ResponseVo enter(@RequestParam Integer parkSpaceId) {
        // 添加车辆进入记录
        parkSpaceWxMiniUserRelationService.userSelectParkSpace(parkSpaceId);
        return ResponseVoUtils.success();
    }
}
